package com.chixing.day04_oop;

public class AccountTest {
   /* public static void main(String[] args) {
        SavingAccount sa = new SavingAccount();
        sa.depoist();//从父类继承的方法
        sa.withdraw();
        sa.fun1();

        CreditAccount ca = new CreditAccount();
        ca.depoist();//从父类继承的方法
        ca.withdraw();
    }*/
   public static void main(String[] args){
       SavingAccount sa1 = new SavingAccount();
       Account acc1 = sa1;
       Account acc2 = new CreditAccount();
       CreditAccount acc3 =(CreditAccount)acc2;


       //CreditAccount ca1 =  new Account();
       SavingAccount acc4 = (SavingAccount)acc1;

       //System.out.print(ca1 instanceof CreditAccount);
       System.out.print(acc2 instanceof CreditAccount);
       System.out.print(acc2 instanceof Account);
       System.out.println(acc3 instanceof CreditAccount);
   }
}
